<script setup lang="ts" name="PageConfigProperty">
import { PageConfigProperty } from './config'
import { usePropertyForm } from '@/components/Designer/utils/index'
// 页面属性面板
// 表单校验
const rules = {}

const props = defineProps<{ modelValue: PageConfigProperty }>()
const emit = defineEmits(['update:modelValue'])
const { formData } = usePropertyForm(props.modelValue, emit)
</script>

<template>
  <ElForm label-width="80px" :model="formData" :rules="rules">
    <ElFormItem label="页面描述" prop="description">
      <ElInput v-model="formData!.description" type="textarea" placeholder="用户通过微信分享给朋友时，会自动显示页面描述" />
    </ElFormItem>
    <ElFormItem label="背景颜色" prop="backgroundColor">
      <ColorInput v-model="formData!.backgroundColor" />
    </ElFormItem>
    <ElFormItem label="背景图片" prop="backgroundImage">
      <UploadImage v-model="formData!.backgroundImage" :limit="1">
        <template #tip>建议宽度 750px</template>
      </UploadImage>
    </ElFormItem>
  </ElForm>
</template>

<style scoped lang="scss"></style>
